<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/WH_OUT_STOCK.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/WH_OUT_STOCK.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'OutStockId',
                footer: "Foots",
                cnName: '出库主',
                name: 'workbusiness/WH_OUT_STOCK',
                url: "/WH_OUT_STOCK/",
                sortName: "CreateOn"
            });
            const editFormFields = ref({"WarehouseId":"","MaterialId":"","WorkCenterId":""});
            const editFormOptions = ref([[{"dataKey":"仓库","data":[],"title":"仓库","field":"WarehouseId","type":"select"},
                               {"dataKey":"物料","data":[],"title":"物料","field":"MaterialId","type":"select"},
                               {"dataKey":"工艺路线","data":[],"title":"工作中心","field":"WorkCenterId","type":"select"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'OutStockId',title:'OutStockId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'WarehouseId',title:'仓库',type:'string',bind:{ key:'仓库',data:[]},width:110,align:'left',sort:true},
                       {field:'MaterialId',title:'物料',type:'string',bind:{ key:'物料',data:[]},width:110,align:'left'},
                       {field:'WorkCenterId',title:'工作中心',type:'string',bind:{ key:'工艺路线',data:[]},width:110,align:'left'},
                       {field:'OutStockType',title:'出库类型',type:'string',width:110,align:'left'},
                       {field:'Description',title:'描述',type:'string',width:110,align:'left'},
                       {field:'Status',title:'Status',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'CreateBy',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'CreateOn',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'UpdateBy',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'LastUpdateOn',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'IsDeleted',type:'bool',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "出库明细",
                table: "WH_OUT_STOCK_DETAIL",
                columns: [{field:'Id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'OutStockId',title:'OutStockId',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'PackBarcode',title:'物料批次码',type:'string',width:110,edit:{type:'text'},align:'left',sort:true},
                       {field:'MaterialId',title:'物料',type:'string',bind:{ key:'物料',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'OutQty',title:'出库数量',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'Description',title:'描述',type:'string',width:110,align:'left'},
                       {field:'Status',title:'状态',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除 0/不删除 1/已删除',type:'bool',width:110,hidden:true,align:'left'}],
                sortName: "CreateOn",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
